package com.llxy.web.controller.worker;
import com.llxy.common.core.controller.BaseController;
import com.llxy.common.core.domain.AjaxResult;
import com.llxy.common.core.page.TableDataInfo;
import com.llxy.worker.domain.Homemaking;
import com.llxy.worker.domain.SupportJob;
import com.llxy.worker.dto.HomemakingRespDTO;
import com.llxy.worker.dto.SupportJobDTO;
import com.llxy.worker.service.SupportJobService;
import com.llxy.worker.service.impl.SupportJobServiceImpl;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
* (t_support_job)表控制层
*
* @author 马瑞龙
*/
@RestController
@RequestMapping("/worker/supportJob")
public class SupportJobController extends BaseController {
    /**
    * 服务对象
    */
    @Autowired
    private SupportJobService supportJobService;


    @PreAuthorize("@ss.hasPermi('worker:supportJob:list')")
    @GetMapping("/list")
    public TableDataInfo list()
    {
        startPage();
        List<HomemakingRespDTO> homemakingDTOList = supportJobService.selectList(getUserId());
        return getDataTable(homemakingDTOList);
    }

    @PreAuthorize("@ss.hasPermi('worker:supportJob:examine')")
    @PutMapping("/examine/{status}/{id}")
    public AjaxResult examine(@PathVariable Integer status,@PathVariable Integer id)
    {
        return success(supportJobService.examine(status,id));
    }

}
